<template>
	<div class="container">
		<div class="center-left">
		<el-row class="tac">
			<el-col :span="3">
				<el-menu default-active="2" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose">
					<el-menu-item index="2">
						<i class="el-icon-user"></i>
						<span slot="title"></span>
						<router-link class="router-link-myinformation" to="/mymessage" >个人信息</router-link>
					</el-menu-item>
          <el-menu-item index="2">
            <i class="el-icon-user-solid"></i>
            <span slot="title"></span>
            <router-link class="router-link-myinformation" to="/inbox" ><span @click="getinbox()">站内信</span></router-link>
          </el-menu-item>
<!-- 					<el-menu-item index="4">
						<i class="el-icon-user-solid"></i>
						<span slot="title"></span>
						<router-link class="router-link-myinformation" to="/changeinformation" >修改头像</router-link>
					</el-menu-item> -->
				</el-menu>
			</el-col>
		</el-row>	
		</div>
		<div class="center-right">
			<router-view></router-view>
		</div>
	</div>
</template>

<script>
import {request} from "../api/axios";

export default {
	name: 'myinformation',
	methods: {
    getinbox() {
      request({
        url: '/v1/messages/receivemessage',
        method: 'post',
        data: {
          page: 1,
          message_type: 0,
          user_name:this.$store.state.userInfo.userName,
        }
      }).then(res => {
        console.log(res.data.data);
        this.$store.state.inboxsimple=res.data.data;
        console.log(this.$store.state.inboxsimple);
      });
    },
		handleOpen(key, keyPath) {
			console.log(key, keyPath);
		},
		handleClose(key, keyPath) {
			console.log(key, keyPath);
		}
	}
};
</script>

<style scoped>
.container{
	width: 100%;
	margin-top: 3rem;
	margin-left: 1rem;

}
.tac{
	width: 2rem;
}
.router-link-myinformation{
	text-decoration: none;
	font-size: 1rem;
	color: #262626;
}
.center-right{
	
	margin-top: -6rem;
	margin-left: 15rem;
    
}
</style>
